package javase0824;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import java.util.TreeMap;

public class Demo03 {
    public static void main(String[] args) {
        Set<Short> s = new HashSet<>();
        for (short i = 0; i < 100; i++) {
            boolean b = s.remove(i - 1);
            //System.out.println(b);
            s.add(i);
        }
        System.out.println(s.size());

        Iterator<Short> it = s.iterator();
        while (it.hasNext()) {
            Short o = it.next();
            System.out.println(o);
            System.out.println(o.getClass());
        }

    }

}
